PATHMac OS 8 Developer Documentation > Operating System Services > Multiprocessing Services >

Adding Multitasking Capability to Applications Using Multiprocessing Services

   

Memory Allocation Alignment Constants

When calling the MPAllocateAligned function, you must specify the alignment of the desired memory block by passing a constant of type UInt8 in the alignment parameter.

enum {
    /* Values for the alignment parameter to MPAllocateAligned.*/
    kMPAllocateDefaultAligned   = 0,
    kMPAllocate8ByteAligned     = 3,
    kMPAllocate16ByteAligned    = 4,
    kMPAllocate32ByteAligned    = 5,
    kMPAllocate1024ByteAligned  = 10,
    kMPAllocate4096ByteAligned  = 12,
    kMPAllocateMaxAlignment     = 16,
    kMPAllocateAltiVecAligned   = kMPAllocate16ByteAligned,
    kMPAllocateVMXAligned       = kMPAllocateAltiVecAligned
    kMPAllocateVMPageAligned    = 254,
    kMPAllocateInterlockAligned = 255
    };

Constant Descriptions

kMPAllocateDefaultAligned
Use the default alignment.
kMPAllocate8ByteAligned
Use 8-byte alignment.
kMPAllocate16ByteAligned
Use 16-byte alignment.
kMPAllocate32ByteAligned
Use 32-byte alignment.
kMPAllocate1024ByteAligned
Use 1024-byte alignment.
kMPAllocate4096ByteAligned
Use 4096-byte alignment.
kMPAllocateMaxAlignment
Use the maximum alignment (65536 byte).
kMPAllocateAltiVecAligned
Use AltiVec alignment.
kMPAllocateVMXAligned
Use VMX (now called AltiVec) alignment.
kMPAllocateVMPageAligned
Use virtual memory page alignment. This alignment is set at runtime.
kMPAllocateInterlockAligned
Use interlock alignment, which is the alignment needed to allow the use of CPU interlock instructions (that is, lwarx and stwcx .) on the returned memory address. This alignment is set at runtime. In most cases you would never need to use this alignment.
VERSION NOTES

Introduced with Multiprocessing Services 2.0.


© 1999 Apple Computer, Inc. – (Last Updated 07 May 99)